<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: /HElib/include/helib/keys.h Source File</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d0c4ae63660968bf6b1c77a1e8aecf95.html">helib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">keys.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="keys_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* Copyright (C) 2012-2020 IBM Corp.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This program is Licensed under the Apache License, Version 2.0</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * with the License. You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * limitations under the License. See accompanying LICENSE file.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#ifndef HELIB_KEYS_H</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#define HELIB_KEYS_H</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="key_switching_8h.html">helib/keySwitching.h</a>&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacehelib.html">helib</a> {</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#define HELIB_KSS_UNKNOWN (0)</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="keys_8h.html#a754b89cca895affa0bbdb0f0be7cc5ac">   28</a></span>&#160;<span class="comment">// unknown KS strategy</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#define HELIB_KSS_FULL (1)</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="keys_8h.html#a388919377ff3fe4f9e9e004395cdae01">   31</a></span>&#160;<span class="comment">// all KS matrices</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#define HELIB_KSS_BSGS (2)</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="keys_8h.html#a49964f2aac6a00561a4b0e80a73ef652">   34</a></span>&#160;<span class="comment">// baby step/giant step strategy</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#define HELIB_KSS_MIN (3)</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="keys_8h.html#a931ca5fef0ab232238fffeb9d7f5de4b">   37</a></span>&#160;<span class="comment">// minimal strategy (for g_i, and for g_i^{-ord_i} for bad dims)</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#a3fe91feb5d65b0afc826f181557a56e4">writePubKeyBinary</a>(std::ostream&amp; str, <span class="keyword">const</span> PubKey&amp; pk);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#adc9656603a03fba1b8720db0d2e5cee9">readPubKeyBinary</a>(std::istream&amp; str, PubKey&amp; pk);</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html">   46</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_pub_key.html">PubKey</a></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;{                         <span class="comment">// The public key</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context; <span class="comment">// The context</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  <a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a> pubEncrKey;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  std::vector&lt;double&gt; skBounds;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  <span class="comment">// High-probability bounds on L-infty norm of secret keys</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  std::vector&lt;KeySwitch&gt; keySwitching; <span class="comment">// The key-switching matrices</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  <span class="comment">// The keySwitchMap structure contains pointers to key-switching matrices</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  <span class="comment">// for re-linearizing automorphisms. The entry keySwitchMap[i][n] contains</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  <span class="comment">// the index j such that keySwitching[j] is the first matrix one needs to</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  <span class="comment">// use when re-linearizing s_i(X^n).</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  std::vector&lt;std::vector&lt;long&gt;&gt; keySwitchMap;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  NTL::Vec&lt;long&gt; KS_strategy; <span class="comment">// NTL Vec&#39;s support I/O, which is more convenient</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <span class="comment">// bootstrapping data</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  <span class="keywordtype">long</span> recryptKeyID; <span class="comment">// index of the bootstrapping key</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a> recryptEkey;  <span class="comment">// the key itself, encrypted under key #0</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <a class="code" href="classhelib_1_1_pub_key.html#aafaeff3bae5bac16d5a4bf127e2f6f2d">PubKey</a>();</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_pub_key.html#aafaeff3bae5bac16d5a4bf127e2f6f2d">PubKey</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; _context);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <a class="code" href="classhelib_1_1_pub_key.html#aafaeff3bae5bac16d5a4bf127e2f6f2d">PubKey</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a>&amp; other);</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html#aabd77762ff776bfbf3ae389b49fa7ac9">   84</a></span>&#160;  <span class="keyword">virtual</span> <a class="code" href="classhelib_1_1_pub_key.html#aabd77762ff776bfbf3ae389b49fa7ac9">~PubKey</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#aa13affb78adf902978fad938c8f56eae">clear</a>();</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#ae7a054c57be24207281e69608bed29b2">operator==</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#a014ede31ce4b686ddf491d30cd7a581a">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  <span class="comment">// Access methods</span></div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; <a class="code" href="classhelib_1_1_pub_key.html#aa58d563a7ee4e27f2c46f97a3f5997dc">getContext</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#aa470fb7bc65e658efd02858188078384">getPtxtSpace</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#aa19bebb6be7b4cedb58a1a045df68b3a">keyExists</a>(<span class="keywordtype">long</span> keyID) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_pub_key.html#af00d3629c7dc16946cc48942edf797fb">getSKeyBound</a>(<span class="keywordtype">long</span> keyID = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  <span class="keyword">const</span> std::vector&lt;KeySwitch&gt;&amp; <a class="code" href="classhelib_1_1_pub_key.html#adf27c278c7ae39ad8f7550774693fe2d">keySWlist</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_key_switch.html">KeySwitch</a>&amp; <a class="code" href="classhelib_1_1_pub_key.html#a36e271b46f74eb1f10deeb15f38ef612">getKeySWmatrix</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_s_k_handle.html">SKHandle</a>&amp; from, <span class="keywordtype">long</span> toID = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_key_switch.html">KeySwitch</a>&amp; <a class="code" href="classhelib_1_1_pub_key.html#a36e271b46f74eb1f10deeb15f38ef612">getKeySWmatrix</a>(<span class="keywordtype">long</span> fromSPower,</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                                  <span class="keywordtype">long</span> fromXPower,</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                                  <span class="keywordtype">long</span> fromID = 0,</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                                  <span class="keywordtype">long</span> toID = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#aabf2e70d488f0e10604861d9d1d1b586">haveKeySWmatrix</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_s_k_handle.html">SKHandle</a>&amp; from, <span class="keywordtype">long</span> toID = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#aabf2e70d488f0e10604861d9d1d1b586">haveKeySWmatrix</a>(<span class="keywordtype">long</span> fromSPower,</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                       <span class="keywordtype">long</span> fromXPower,</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                       <span class="keywordtype">long</span> fromID = 0,</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                       <span class="keywordtype">long</span> toID = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_key_switch.html">KeySwitch</a>&amp; <a class="code" href="classhelib_1_1_pub_key.html#a78cf90689deb41b4dcd2346722e22d9d">getAnyKeySWmatrix</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_s_k_handle.html">SKHandle</a>&amp; from) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#a85d422013d6854bd95947a75da4ccf63">haveAnyKeySWmatrix</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_s_k_handle.html">SKHandle</a>&amp; from) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_key_switch.html">KeySwitch</a>&amp; <a class="code" href="classhelib_1_1_pub_key.html#a0a9ef8dbc3d89b669b8b375352a64e0c">getNextKSWmatrix</a>(<span class="keywordtype">long</span> fromXPower, <span class="keywordtype">long</span> fromID = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#a67598f5056cba7b1b94fcdd8482a947c">isReachable</a>(<span class="keywordtype">long</span> k, <span class="keywordtype">long</span> keyID = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#a8abfcc223328521acf1976e5dd33ba53">setKeySwitchMap</a>(<span class="keywordtype">long</span> keyId = 0); <span class="comment">// Computes the keySwitchMap pointers</span></div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#a5b98b32c0ec476420d0d6f817cccd82c">getKSStrategy</a>(<span class="keywordtype">long</span> dim) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#a448fbc74eecbdb3b369dcea9c5d85ce2">setKSStrategy</a>(<span class="keywordtype">long</span> dim, <span class="keywordtype">int</span> val);</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#a0346c2c214b648809f6b754de9e5d431">Encrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;               <span class="keyword">const</span> NTL::ZZX&amp; plaintxt,</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;               <span class="keywordtype">long</span> ptxtSpace,</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;               <span class="keywordtype">bool</span> highNoise) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#a0346c2c214b648809f6b754de9e5d431">Encrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;               <span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; plaintxt,</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;               <span class="keywordtype">long</span> ptxtSpace,</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;               <span class="keywordtype">bool</span> highNoise) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#aafbfc62d5d78c39aa7929d552b31ff03">CKKSencrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;                   <span class="keyword">const</span> NTL::ZZX&amp; plaintxt,</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;                   <span class="keywordtype">double</span> ptxtSize = 1.0,</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;                   <span class="keywordtype">double</span> scaling = 0.0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#aafbfc62d5d78c39aa7929d552b31ff03">CKKSencrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;                   <span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; plaintxt,</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;                   <span class="keywordtype">double</span> ptxtSize = 1.0,</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;                   <span class="keywordtype">double</span> scaling = 0.0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  <span class="comment">// These methods are overridden by secret-key Encrypt</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#a0346c2c214b648809f6b754de9e5d431">Encrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;                       <span class="keyword">const</span> NTL::ZZX&amp; plaintxt,</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;                       <span class="keywordtype">long</span> ptxtSpace = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#a0346c2c214b648809f6b754de9e5d431">Encrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;                       <span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; plaintxt,</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;                       <span class="keywordtype">long</span> ptxtSpace = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160; </div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Scheme&gt;</div>
<div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html#ab26be749db4dd2b5d102a77bf70f4de3">  191</a></span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#ab26be749db4dd2b5d102a77bf70f4de3">Encrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;               <span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; plaintxt,</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;               <span class="keywordtype">long</span> ptxtSpace = 0) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160; </div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#ab8aed3e83355c67529fa2f53b2fb1ba5">isCKKS</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  <span class="comment">// NOTE: Is taking the alMod from the context the right thing to do?</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160; </div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_pub_key.html#ad0ad65deb509b0e020dd603a4857492a">isBootstrappable</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#a65479b612f5d28386fb1205858416957">reCrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ctxt) <span class="keyword">const</span>;     <span class="comment">// bootstrap a ciphertext to reduce noise</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#ac442b7e06a49fde0d0cd067f00c259e8">thinReCrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ctxt) <span class="keyword">const</span>; <span class="comment">// bootstrap a &quot;thin&quot; ciphertext, where</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;  <span class="comment">// slots are assumed to contain constants</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160; </div>
<div class="line"><a name="l00203"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html#a5b5d89141b4d68c0830b9fe4468ac8f7">  203</a></span>&#160;  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classhelib_1_1_sec_key.html">SecKey</a>;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classhelib_1_1_pub_key.html#a963530e960d2799753da76e3f3495b10">operator&lt;&lt;</a>(std::ostream&amp; str, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a>&amp; pk);</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  <span class="keyword">friend</span> std::istream&amp; <a class="code" href="classhelib_1_1_pub_key.html#a2bdb05bdd189940f7ed0b25ab89fa1ad">operator&gt;&gt;</a>(std::istream&amp; str, <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a>&amp; pk);</div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html#a45c4f7b5816402ddaf16c7df1b60b9c6">  206</a></span>&#160;  <span class="keyword">friend</span> <a class="code" href="namespacehelib.html#a3fe91feb5d65b0afc826f181557a56e4">void ::helib::writePubKeyBinary</a>(std::ostream&amp; str, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a>&amp; pk);</div>
<div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html#a97b95f757398bed078ac7e01efd96ec3">  207</a></span>&#160;  <span class="keyword">friend</span> <a class="code" href="namespacehelib.html#adc9656603a03fba1b8720db0d2e5cee9">void ::helib::readPubKeyBinary</a>(std::istream&amp; str, <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a>&amp; pk);</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;  <span class="comment">// defines plaintext space for the bootstrapping encrypted secret key</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html#ac16ee4cbf52d86accf5f7e82a83f3991">  210</a></span>&#160;  <span class="keyword">static</span> <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_pub_key.html#ac16ee4cbf52d86accf5f7e82a83f3991">ePlusR</a>(<span class="keywordtype">long</span> p);</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  <span class="comment">// A hack to increase the plaintext space, you&#39;d better</span></div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;  <span class="comment">// know what you are doing when using it.</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"><a class="line" href="classhelib_1_1_pub_key.html#ad607fc183a04a38ea758df7094957410">  214</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_pub_key.html#ad607fc183a04a38ea758df7094957410">hackPtxtSpace</a>(<span class="keywordtype">long</span> p2r) { pubEncrKey.ptxtSpace = p2r; }</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;};</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#a360f4b2c5989ceac05b2f37fe89239f2">writeSecKeyBinary</a>(std::ostream&amp; str, <span class="keyword">const</span> SecKey&amp; sk);</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#a69b0297bb0e296d5dc39bb328d735007">readSecKeyBinary</a>(std::istream&amp; str, SecKey&amp; sk);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="classhelib_1_1_sec_key.html">  224</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_sec_key.html">SecKey</a> : <span class="keyword">public</span> <a class="code" href="classhelib_1_1_pub_key.html">PubKey</a></div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;{ <span class="comment">// The secret key</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="classhelib_1_1_sec_key.html#a9b5d86313db97a999d6022030c81062e">  227</a></span>&#160;  std::vector&lt;DoubleCRT&gt; <a class="code" href="classhelib_1_1_sec_key.html#a9b5d86313db97a999d6022030c81062e">sKeys</a>; <span class="comment">// The secret key(s) themselves</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160; </div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  <span class="comment">// Disable default constructor</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"><a class="line" href="classhelib_1_1_sec_key.html#a6e4c7855fbe80883f4207e011c74e22b">  231</a></span>&#160;  <a class="code" href="classhelib_1_1_sec_key.html#a6e4c7855fbe80883f4207e011c74e22b">SecKey</a>() = <span class="keyword">delete</span>;</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;  <span class="comment">// Default destructor</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classhelib_1_1_sec_key.html#a4a76975c743941bae142bd524de4d3ee">  234</a></span>&#160;  <a class="code" href="classhelib_1_1_sec_key.html#a4a76975c743941bae142bd524de4d3ee">~SecKey</a>() <span class="keyword">override</span> = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160; </div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;  <span class="comment">// Constructors just call the ones for the base class</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_sec_key.html#a6e4c7855fbe80883f4207e011c74e22b">SecKey</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; _context);</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_sec_key.html#a89f716652c0dcd439905d4769647040d">operator==</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_sec_key.html">SecKey</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_sec_key.html#a0d2a050b717383ff79c735306002b89f">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_sec_key.html">SecKey</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160; </div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_sec_key.html#ae51b00cb02aa6e958f19c8a27eb40204">clear</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160; </div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_sec_key.html#a8b196190eb15a05ebc9504a24fac4dcc">ImportSecKey</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; sKey,</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;                    <span class="keywordtype">double</span> bound,</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;                    <span class="keywordtype">long</span> ptxtSpace = 0,</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;                    <span class="keywordtype">long</span> maxDegKswitch = 3);</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160; </div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_sec_key.html#a101e0d4a5d06aaab7db1c1a776fc66c6">GenSecKey</a>(<span class="keywordtype">long</span> hwt = 0, <span class="keywordtype">long</span> ptxtSpace = 0, <span class="keywordtype">long</span> maxDegKswitch = 3);</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160; </div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_sec_key.html#a350d34d3415174be94701ed1b62fc0b0">GenKeySWmatrix</a>(<span class="keywordtype">long</span> fromSPower,</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;                      <span class="keywordtype">long</span> fromXPower,</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;                      <span class="keywordtype">long</span> fromKeyIdx = 0,</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;                      <span class="keywordtype">long</span> toKeyIdx = 0,</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;                      <span class="keywordtype">long</span> ptxtSpace = 0);</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160; </div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;  <span class="comment">// Decryption</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_sec_key.html#a3d0dd7ac99a4431c16149607adf46995">Decrypt</a>(NTL::ZZX&amp; plaintxt, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160; </div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Scheme&gt;</div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classhelib_1_1_sec_key.html#a64b2c5e68619fb09448d91c697827fec">  282</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_sec_key.html#a64b2c5e68619fb09448d91c697827fec">Decrypt</a>(<a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; plaintxt, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_sec_key.html#a3d0dd7ac99a4431c16149607adf46995">Decrypt</a>(NTL::ZZX&amp; plaintxt, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt, NTL::ZZX&amp; f) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160; </div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_sec_key.html#ad4dce93de49598069ce22e850c4ce824">skEncrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ctxt,</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                 <span class="keyword">const</span> NTL::ZZX&amp; ptxt,</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;                 <span class="keywordtype">long</span> ptxtSpace,</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;                 <span class="keywordtype">long</span> skIdx) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_sec_key.html#ad4dce93de49598069ce22e850c4ce824">skEncrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ctxt, <span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; ptxt, <span class="keywordtype">long</span> ptxtSpace, <span class="keywordtype">long</span> skIdx) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160; </div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;  <span class="comment">// These methods override the public-key Encrypt methods</span></div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_sec_key.html#a623e7afa711f904482381dd31476502d">Encrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;               <span class="keyword">const</span> NTL::ZZX&amp; plaintxt,</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;               <span class="keywordtype">long</span> ptxtSpace = 0) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_sec_key.html#a623e7afa711f904482381dd31476502d">Encrypt</a>(<a class="code" href="classhelib_1_1_ctxt.html">Ctxt</a>&amp; ciphertxt,</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;               <span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; plaintxt,</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;               <span class="keywordtype">long</span> ptxtSpace = 0) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160; </div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_sec_key.html#a69d79957cc0259376b9ab024c2d643dd">genRecryptData</a>();</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160; </div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classhelib_1_1_sec_key.html#a99109270d1e866593aee2b0e9a7cdc8d">operator&lt;&lt;</a>(std::ostream&amp; str, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_sec_key.html">SecKey</a>&amp; sk);</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;  <span class="keyword">friend</span> std::istream&amp; <a class="code" href="classhelib_1_1_sec_key.html#a7742d711e4a9d3b19e31e5113c60107e">operator&gt;&gt;</a>(std::istream&amp; str, <a class="code" href="classhelib_1_1_sec_key.html">SecKey</a>&amp; sk);</div>
<div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="classhelib_1_1_sec_key.html#a1e15e33f3688426b326404123804291a">  308</a></span>&#160;  <span class="keyword">friend</span> <a class="code" href="namespacehelib.html#a360f4b2c5989ceac05b2f37fe89239f2">void ::helib::writeSecKeyBinary</a>(std::ostream&amp; str, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_sec_key.html">SecKey</a>&amp; sk);</div>
<div class="line"><a name="l00309"></a><span class="lineno"><a class="line" href="classhelib_1_1_sec_key.html#a7f35adf909fde993329e2253f54565f4">  309</a></span>&#160;  <span class="keyword">friend</span> <a class="code" href="namespacehelib.html#a69b0297bb0e296d5dc39bb328d735007">void ::helib::readSecKeyBinary</a>(std::istream&amp; str, <a class="code" href="classhelib_1_1_sec_key.html">SecKey</a>&amp; sk);</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;};</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160; </div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespacehelib.html#a1f74d875dc046b81eef94c8f091e5c09">RLWE</a>(<a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; c0,</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;            <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; c1,</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;            <span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; s,</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;            <span class="keywordtype">long</span> p,</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;            NTL::ZZ* prgSeed = <span class="keyword">nullptr</span>);</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160; </div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;<span class="keywordtype">double</span> <a class="code" href="namespacehelib.html#a4349e62cf946950025929996328abf7c">RLWE1</a>(<a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; c0, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; c1, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; s, <span class="keywordtype">long</span> p);</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160; </div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;} <span class="comment">// namespace helib</span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160; </div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;<span class="preprocessor">#endif // HELIB_KEYS_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasshelib_1_1_ptxt_html"><div class="ttname"><a href="classhelib_1_1_ptxt.html">helib::Ptxt</a></div><div class="ttdoc">An object that mimics the functionality of the Ctxt object, and acts as a convenient entry point for ...</div><div class="ttdef"><b>Definition:</b> Ctxt.h:66</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a6e4c7855fbe80883f4207e011c74e22b"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a6e4c7855fbe80883f4207e011c74e22b">helib::SecKey::SecKey</a></div><div class="ttdeci">SecKey()=delete</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aabf2e70d488f0e10604861d9d1d1b586"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aabf2e70d488f0e10604861d9d1d1b586">helib::PubKey::haveKeySWmatrix</a></div><div class="ttdeci">bool haveKeySWmatrix(const SKHandle &amp;from, long toID=0) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:287</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a65479b612f5d28386fb1205858416957"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a65479b612f5d28386fb1205858416957">helib::PubKey::reCrypt</a></div><div class="ttdeci">void reCrypt(Ctxt &amp;ctxt) const</div><div class="ttdef"><b>Definition:</b> recryption.cpp:365</div></div>
<div class="ttc" id="anamespacehelib_html_adc9656603a03fba1b8720db0d2e5cee9"><div class="ttname"><a href="namespacehelib.html#adc9656603a03fba1b8720db0d2e5cee9">helib::readPubKeyBinary</a></div><div class="ttdeci">void readPubKeyBinary(std::istream &amp;str, PubKey &amp;pk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:759</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a5b98b32c0ec476420d0d6f817cccd82c"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a5b98b32c0ec476420d0d6f817cccd82c">helib::PubKey::getKSStrategy</a></div><div class="ttdeci">long getKSStrategy(long dim) const</div><div class="ttdoc">get KS strategy for dimension dim dim == -1 is Frobenius</div><div class="ttdef"><b>Definition:</b> keys.cpp:316</div></div>
<div class="ttc" id="anamespacehelib_html_a4d6002f36f1a61982fded09adf1331ca"><div class="ttname"><a href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">helib::zzX</a></div><div class="ttdeci">NTL::Vec&lt; long &gt; zzX</div><div class="ttdef"><b>Definition:</b> zzX.h:24</div></div>
<div class="ttc" id="akey_switching_8h_html"><div class="ttname"><a href="key_switching_8h.html">keySwitching.h</a></div><div class="ttdoc">Declaration of key switching matrices</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a85d422013d6854bd95947a75da4ccf63"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a85d422013d6854bd95947a75da4ccf63">helib::PubKey::haveAnyKeySWmatrix</a></div><div class="ttdeci">bool haveAnyKeySWmatrix(const SKHandle &amp;from) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:300</div></div>
<div class="ttc" id="anamespacehelib_html_a4349e62cf946950025929996328abf7c"><div class="ttname"><a href="namespacehelib.html#a4349e62cf946950025929996328abf7c">helib::RLWE1</a></div><div class="ttdeci">double RLWE1(DoubleCRT &amp;c0, const DoubleCRT &amp;c1, const DoubleCRT &amp;s, long p)</div><div class="ttdoc">Same as RLWE, but assumes that c1 is already chosen by the caller.</div><div class="ttdef"><b>Definition:</b> keys.cpp:29</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a0d2a050b717383ff79c735306002b89f"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a0d2a050b717383ff79c735306002b89f">helib::SecKey::operator!=</a></div><div class="ttdeci">bool operator!=(const SecKey &amp;other) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:815</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a89f716652c0dcd439905d4769647040d"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a89f716652c0dcd439905d4769647040d">helib::SecKey::operator==</a></div><div class="ttdeci">bool operator==(const SecKey &amp;other) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:800</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a99109270d1e866593aee2b0e9a7cdc8d"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a99109270d1e866593aee2b0e9a7cdc8d">helib::SecKey::operator&lt;&lt;</a></div><div class="ttdeci">friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp;str, const SecKey &amp;sk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:1288</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html">helib::DoubleCRT</a></div><div class="ttdoc">Implementing polynomials (elements in the ring R_Q) in double-CRT form.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:76</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_ab26be749db4dd2b5d102a77bf70f4de3"><div class="ttname"><a href="classhelib_1_1_pub_key.html#ab26be749db4dd2b5d102a77bf70f4de3">helib::PubKey::Encrypt</a></div><div class="ttdeci">long Encrypt(Ctxt &amp;ciphertxt, const Ptxt&lt; Scheme &gt; &amp;plaintxt, long ptxtSpace=0) const</div><div class="ttdoc">Encrypts a plaintext into a ciphertext.</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a7742d711e4a9d3b19e31e5113c60107e"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a7742d711e4a9d3b19e31e5113c60107e">helib::SecKey::operator&gt;&gt;</a></div><div class="ttdeci">friend std::istream &amp; operator&gt;&gt;(std::istream &amp;str, SecKey &amp;sk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:1297</div></div>
<div class="ttc" id="anamespacehelib_html_a3fe91feb5d65b0afc826f181557a56e4"><div class="ttname"><a href="namespacehelib.html#a3fe91feb5d65b0afc826f181557a56e4">helib::writePubKeyBinary</a></div><div class="ttdeci">void writePubKeyBinary(std::ostream &amp;str, const PubKey &amp;pk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:724</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a67598f5056cba7b1b94fcdd8482a947c"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a67598f5056cba7b1b94fcdd8482a947c">helib::PubKey::isReachable</a></div><div class="ttdeci">bool isReachable(long k, long keyID=0) const</div><div class="ttdoc">Is it possible to re-linearize the automorphism X -&gt; X^k See Section 3.2.2 in the design document (Ke...</div><div class="ttdef"><b>Definition:</b> keys.cpp:311</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a101e0d4a5d06aaab7db1c1a776fc66c6"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a101e0d4a5d06aaab7db1c1a776fc66c6">helib::SecKey::GenSecKey</a></div><div class="ttdeci">long GenSecKey(long hwt=0, long ptxtSpace=0, long maxDegKswitch=3)</div><div class="ttdef"><b>Definition:</b> keys.cpp:869</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a64b2c5e68619fb09448d91c697827fec"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a64b2c5e68619fb09448d91c697827fec">helib::SecKey::Decrypt</a></div><div class="ttdeci">void Decrypt(Ptxt&lt; Scheme &gt; &amp;plaintxt, const Ctxt &amp;ciphertxt) const</div><div class="ttdoc">Decrypt a ciphertext into a plaintext.</div></div>
<div class="ttc" id="aclasshelib_1_1_key_switch_html"><div class="ttname"><a href="classhelib_1_1_key_switch.html">helib::KeySwitch</a></div><div class="ttdoc">Key-switching matrices.</div><div class="ttdef"><b>Definition:</b> keySwitching.h:87</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aa13affb78adf902978fad938c8f56eae"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aa13affb78adf902978fad938c8f56eae">helib::PubKey::clear</a></div><div class="ttdeci">virtual void clear()</div><div class="ttdoc">Clear all public-key data.</div><div class="ttdef"><b>Definition:</b> keys.cpp:107</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a8abfcc223328521acf1976e5dd33ba53"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a8abfcc223328521acf1976e5dd33ba53">helib::PubKey::setKeySwitchMap</a></div><div class="ttdeci">void setKeySwitchMap(long keyId=0)</div><div class="ttdoc">Compute the reachability graph of key-switching matrices See Section 3.2.2 in the design document (Ke...</div><div class="ttdef"><b>Definition:</b> keys.cpp:117</div></div>
<div class="ttc" id="aclasshelib_1_1_s_k_handle_html"><div class="ttname"><a href="classhelib_1_1_s_k_handle.html">helib::SKHandle</a></div><div class="ttdoc">A handle, describing the secret-key element that &quot;matches&quot; a part, of the form s^r(X^t).</div><div class="ttdef"><b>Definition:</b> Ctxt.h:78</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_ad0ad65deb509b0e020dd603a4857492a"><div class="ttname"><a href="classhelib_1_1_pub_key.html#ad0ad65deb509b0e020dd603a4857492a">helib::PubKey::isBootstrappable</a></div><div class="ttdeci">bool isBootstrappable() const</div><div class="ttdef"><b>Definition:</b> keys.cpp:629</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_ac16ee4cbf52d86accf5f7e82a83f3991"><div class="ttname"><a href="classhelib_1_1_pub_key.html#ac16ee4cbf52d86accf5f7e82a83f3991">helib::PubKey::ePlusR</a></div><div class="ttdeci">static long ePlusR(long p)</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_ad607fc183a04a38ea758df7094957410"><div class="ttname"><a href="classhelib_1_1_pub_key.html#ad607fc183a04a38ea758df7094957410">helib::PubKey::hackPtxtSpace</a></div><div class="ttdeci">void hackPtxtSpace(long p2r)</div><div class="ttdef"><b>Definition:</b> keys.h:214</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a350d34d3415174be94701ed1b62fc0b0"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a350d34d3415174be94701ed1b62fc0b0">helib::SecKey::GenKeySWmatrix</a></div><div class="ttdeci">void GenKeySWmatrix(long fromSPower, long fromXPower, long fromKeyIdx=0, long toKeyIdx=0, long ptxtSpace=0)</div><div class="ttdef"><b>Definition:</b> keys.cpp:886</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aabd77762ff776bfbf3ae389b49fa7ac9"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aabd77762ff776bfbf3ae389b49fa7ac9">helib::PubKey::~PubKey</a></div><div class="ttdeci">virtual ~PubKey()=default</div><div class="ttdoc">Default destructor.</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a963530e960d2799753da76e3f3495b10"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a963530e960d2799753da76e3f3495b10">helib::PubKey::operator&lt;&lt;</a></div><div class="ttdeci">friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp;str, const PubKey &amp;pk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:631</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_ae51b00cb02aa6e958f19c8a27eb40204"><div class="ttname"><a href="classhelib_1_1_sec_key.html#ae51b00cb02aa6e958f19c8a27eb40204">helib::SecKey::clear</a></div><div class="ttdeci">void clear() override</div><div class="ttdoc">Clear all secret-key data.</div><div class="ttdef"><b>Definition:</b> keys.cpp:817</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a4a76975c743941bae142bd524de4d3ee"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a4a76975c743941bae142bd524de4d3ee">helib::SecKey::~SecKey</a></div><div class="ttdeci">~SecKey() override=default</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aa470fb7bc65e658efd02858188078384"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aa470fb7bc65e658efd02858188078384">helib::PubKey::getPtxtSpace</a></div><div class="ttdeci">long getPtxtSpace() const</div><div class="ttdef"><b>Definition:</b> keys.cpp:269</div></div>
<div class="ttc" id="anamespacehelib_html_a360f4b2c5989ceac05b2f37fe89239f2"><div class="ttname"><a href="namespacehelib.html#a360f4b2c5989ceac05b2f37fe89239f2">helib::writeSecKeyBinary</a></div><div class="ttdeci">void writeSecKeyBinary(std::ostream &amp;str, const SecKey &amp;sk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:1314</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_adf27c278c7ae39ad8f7550774693fe2d"><div class="ttname"><a href="classhelib_1_1_pub_key.html#adf27c278c7ae39ad8f7550774693fe2d">helib::PubKey::keySWlist</a></div><div class="ttdeci">const std::vector&lt; KeySwitch &gt; &amp; keySWlist() const</div><div class="ttdef"><b>Definition:</b> keys.cpp:277</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a69d79957cc0259376b9ab024c2d643dd"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a69d79957cc0259376b9ab024c2d643dd">helib::SecKey::genRecryptData</a></div><div class="ttdeci">long genRecryptData()</div><div class="ttdoc">Generate bootstrapping data if needed, returns index of key.</div><div class="ttdef"><b>Definition:</b> keys.cpp:1253</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_ac442b7e06a49fde0d0cd067f00c259e8"><div class="ttname"><a href="classhelib_1_1_pub_key.html#ac442b7e06a49fde0d0cd067f00c259e8">helib::PubKey::thinReCrypt</a></div><div class="ttdeci">void thinReCrypt(Ctxt &amp;ctxt) const</div><div class="ttdef"><b>Definition:</b> recryption.cpp:939</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a78cf90689deb41b4dcd2346722e22d9d"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a78cf90689deb41b4dcd2346722e22d9d">helib::PubKey::getAnyKeySWmatrix</a></div><div class="ttdeci">const KeySwitch &amp; getAnyKeySWmatrix(const SKHandle &amp;from) const</div><div class="ttdoc">Is there a matrix from this key to any base key?</div><div class="ttdef"><b>Definition:</b> keys.cpp:190</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html"><div class="ttname"><a href="classhelib_1_1_pub_key.html">helib::PubKey</a></div><div class="ttdoc">The public key.</div><div class="ttdef"><b>Definition:</b> keys.h:47</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aafbfc62d5d78c39aa7929d552b31ff03"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aafbfc62d5d78c39aa7929d552b31ff03">helib::PubKey::CKKSencrypt</a></div><div class="ttdeci">void CKKSencrypt(Ctxt &amp;ciphertxt, const NTL::ZZX &amp;plaintxt, double ptxtSize=1.0, double scaling=0.0) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:497</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a0346c2c214b648809f6b754de9e5d431"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a0346c2c214b648809f6b754de9e5d431">helib::PubKey::Encrypt</a></div><div class="ttdeci">long Encrypt(Ctxt &amp;ciphertxt, const NTL::ZZX &amp;plaintxt, long ptxtSpace, bool highNoise) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:353</div></div>
<div class="ttc" id="anamespacehelib_html"><div class="ttname"><a href="namespacehelib.html">helib</a></div><div class="ttdef"><b>Definition:</b> apiAttributes.h:21</div></div>
<div class="ttc" id="anamespacehelib_html_a1f74d875dc046b81eef94c8f091e5c09"><div class="ttname"><a href="namespacehelib.html#a1f74d875dc046b81eef94c8f091e5c09">helib::RLWE</a></div><div class="ttdeci">double RLWE(DoubleCRT &amp;c0, DoubleCRT &amp;c1, const DoubleCRT &amp;s, long p, NTL::ZZ *prgSeed=nullptr)</div><div class="ttdef"><b>Definition:</b> keys.cpp:65</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a448fbc74eecbdb3b369dcea9c5d85ce2"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a448fbc74eecbdb3b369dcea9c5d85ce2">helib::PubKey::setKSStrategy</a></div><div class="ttdeci">void setKSStrategy(long dim, int val)</div><div class="ttdoc">set KS strategy for dimension dim dim == -1 is Frobenius</div><div class="ttdef"><b>Definition:</b> keys.cpp:330</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html"><div class="ttname"><a href="classhelib_1_1_sec_key.html">helib::SecKey</a></div><div class="ttdoc">The secret key.</div><div class="ttdef"><b>Definition:</b> keys.h:225</div></div>
<div class="ttc" id="aclasshelib_1_1_context_html"><div class="ttname"><a href="classhelib_1_1_context.html">helib::Context</a></div><div class="ttdoc">Maintaining the parameters.</div><div class="ttdef"><b>Definition:</b> Context.h:58</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a3d0dd7ac99a4431c16149607adf46995"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a3d0dd7ac99a4431c16149607adf46995">helib::SecKey::Decrypt</a></div><div class="ttdeci">void Decrypt(NTL::ZZX &amp;plaintxt, const Ctxt &amp;ciphertxt) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:983</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a0a9ef8dbc3d89b669b8b375352a64e0c"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a0a9ef8dbc3d89b669b8b375352a64e0c">helib::PubKey::getNextKSWmatrix</a></div><div class="ttdeci">const KeySwitch &amp; getNextKSWmatrix(long fromXPower, long fromID=0) const</div><div class="ttdoc">Get the next matrix to use for multi-hop automorphism See Section 3.2.2 in the design document.</div><div class="ttdef"><b>Definition:</b> keys.cpp:305</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_ad4dce93de49598069ce22e850c4ce824"><div class="ttname"><a href="classhelib_1_1_sec_key.html#ad4dce93de49598069ce22e850c4ce824">helib::SecKey::skEncrypt</a></div><div class="ttdeci">long skEncrypt(Ctxt &amp;ctxt, const NTL::ZZX &amp;ptxt, long ptxtSpace, long skIdx) const</div><div class="ttdoc">Symmetric encryption using the secret key.</div><div class="ttdef"><b>Definition:</b> keys.cpp:1128</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a623e7afa711f904482381dd31476502d"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a623e7afa711f904482381dd31476502d">helib::SecKey::Encrypt</a></div><div class="ttdeci">long Encrypt(Ctxt &amp;ciphertxt, const NTL::ZZX &amp;plaintxt, long ptxtSpace=0) const override</div><div class="ttdef"><b>Definition:</b> keys.cpp:1241</div></div>
<div class="ttc" id="aclasshelib_1_1_ctxt_html"><div class="ttname"><a href="classhelib_1_1_ctxt.html">helib::Ctxt</a></div><div class="ttdoc">A Ctxt object holds a single ciphertext.</div><div class="ttdef"><b>Definition:</b> Ctxt.h:270</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aafaeff3bae5bac16d5a4bf127e2f6f2d"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aafaeff3bae5bac16d5a4bf127e2f6f2d">helib::PubKey::PubKey</a></div><div class="ttdeci">PubKey()</div><div class="ttdoc">This constructor thorws run-time error if activeContext=nullptr.</div><div class="ttdef"><b>Definition:</b> keys.cpp:80</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a014ede31ce4b686ddf491d30cd7a581a"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a014ede31ce4b686ddf491d30cd7a581a">helib::PubKey::operator!=</a></div><div class="ttdeci">bool operator!=(const PubKey &amp;other) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:266</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_af00d3629c7dc16946cc48942edf797fb"><div class="ttname"><a href="classhelib_1_1_pub_key.html#af00d3629c7dc16946cc48942edf797fb">helib::PubKey::getSKeyBound</a></div><div class="ttdeci">double getSKeyBound(long keyID=0) const</div><div class="ttdoc">The size of the secret key.</div><div class="ttdef"><b>Definition:</b> keys.cpp:275</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a2bdb05bdd189940f7ed0b25ab89fa1ad"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a2bdb05bdd189940f7ed0b25ab89fa1ad">helib::PubKey::operator&gt;&gt;</a></div><div class="ttdeci">friend std::istream &amp; operator&gt;&gt;(std::istream &amp;str, PubKey &amp;pk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:669</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aa58d563a7ee4e27f2c46f97a3f5997dc"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aa58d563a7ee4e27f2c46f97a3f5997dc">helib::PubKey::getContext</a></div><div class="ttdeci">const Context &amp; getContext() const</div><div class="ttdef"><b>Definition:</b> keys.cpp:268</div></div>
<div class="ttc" id="anamespacehelib_html_a69b0297bb0e296d5dc39bb328d735007"><div class="ttname"><a href="namespacehelib.html#a69b0297bb0e296d5dc39bb328d735007">helib::readSecKeyBinary</a></div><div class="ttdeci">void readSecKeyBinary(std::istream &amp;str, SecKey &amp;sk)</div><div class="ttdef"><b>Definition:</b> keys.cpp:1329</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a9b5d86313db97a999d6022030c81062e"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a9b5d86313db97a999d6022030c81062e">helib::SecKey::sKeys</a></div><div class="ttdeci">std::vector&lt; DoubleCRT &gt; sKeys</div><div class="ttdef"><b>Definition:</b> keys.h:227</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_ab8aed3e83355c67529fa2f53b2fb1ba5"><div class="ttname"><a href="classhelib_1_1_pub_key.html#ab8aed3e83355c67529fa2f53b2fb1ba5">helib::PubKey::isCKKS</a></div><div class="ttdeci">bool isCKKS() const</div><div class="ttdef"><b>Definition:</b> keys.cpp:623</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_a36e271b46f74eb1f10deeb15f38ef612"><div class="ttname"><a href="classhelib_1_1_pub_key.html#a36e271b46f74eb1f10deeb15f38ef612">helib::PubKey::getKeySWmatrix</a></div><div class="ttdeci">const KeySwitch &amp; getKeySWmatrix(const SKHandle &amp;from, long toID=0) const</div><div class="ttdoc">Find a key-switching matrix by its indexes. If no such matrix exists it returns a dummy matrix with t...</div><div class="ttdef"><b>Definition:</b> keys.cpp:169</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_aa19bebb6be7b4cedb58a1a045df68b3a"><div class="ttname"><a href="classhelib_1_1_pub_key.html#aa19bebb6be7b4cedb58a1a045df68b3a">helib::PubKey::keyExists</a></div><div class="ttdeci">bool keyExists(long keyID) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:270</div></div>
<div class="ttc" id="aclasshelib_1_1_pub_key_html_ae7a054c57be24207281e69608bed29b2"><div class="ttname"><a href="classhelib_1_1_pub_key.html#ae7a054c57be24207281e69608bed29b2">helib::PubKey::operator==</a></div><div class="ttdeci">bool operator==(const PubKey &amp;other) const</div><div class="ttdef"><b>Definition:</b> keys.cpp:211</div></div>
<div class="ttc" id="aclasshelib_1_1_sec_key_html_a8b196190eb15a05ebc9504a24fac4dcc"><div class="ttname"><a href="classhelib_1_1_sec_key.html#a8b196190eb15a05ebc9504a24fac4dcc">helib::SecKey::ImportSecKey</a></div><div class="ttdeci">long ImportSecKey(const DoubleCRT &amp;sKey, double bound, long ptxtSpace=0, long maxDegKswitch=3)</div><div class="ttdef"><b>Definition:</b> keys.cpp:829</div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
